import Vue from 'vue'
import VueRouter from 'vue-router'
import Navigation from '../views/Navigation.vue'
import Register from '../views/Register.vue'
import Login from '../views/Login.vue'
import Detail from '../views/Detail.vue'
import Comment from '../views/Comment.vue'
import Index from '../views/Index.vue'
import indexHome from '../components/indexCom/index-home.vue'
import nb from '../components/indexCom/navigation-banner.vue'
import nali from '../components/navigation/navigation-list.vue'
import IfReg from '../views/ifReg'
import Personal from '../views/Personal'
import psCenter from '../views/psCenter'
import Forgetpassword from '../views/Forgetpassword.vue'

//引入评论区组件
import comm from '../components/comt/comm.vue'
//引入后台管理组件
import console from '../components/comt/console.vue'
import nofound from '../views/404.vue'


Vue.use(VueRouter)

const routes = [
    {
    path: '/',
    redirect:"/index" 
  },{
    path: '/index',
    //测试路由
    children: [
      { path: '', redirect:'home' },
      { path: 'home', component: indexHome },//大图
      { path: 'navigation/:typeId', component: Navigation,props:true},
      { path: 'nalist/:typeId',component: nali,props:true},
      { path: 'nb/:keyValue', component: nb,props:true},
      { path: 'c', },
      { path: 'd',  },
      { path: 'e', },
      { path: 'f',  },
    ],
    component: Index,
  },
  { path: '/center',  component: psCenter},
  // 添加控制台页面组件路由到路由列表
  {
    path: '/console',
    name: 'console',
    component: console
  },
  
  {
    path: '/personal',
    name: 'personal',
    component: Personal
  },
  //引入新版评论页
  {
    path: '/comm',
    name: 'comm',
    component: comm
  },
  {
    path: '/navigation',
    component: Navigation
  },
  {
    path: '/reg',
    component: Register
  },
  {
    path: '/login',
    component: Login
  },
  {
    path: '/detail',
    component: Detail
  },
  {
    path: '/comment',
    component: Comment
  },
  {
    path: '/ifreg',
    component: IfReg
  },
  {
     path: '/forgetpassword',
     component: Forgetpassword
  },
  {
    path:'*',
    component:nofound
  }
  
  
  // {
  //   path: '/',
  //   // route level code-splitting
  //   // this generates a separate chunk (about.[hash].js) for this route
  //   // which is lazy-loaded when the route is visited.
  //   component: () => import(/* webpackChunkName: "index" */ '../views/Index.vue')
  // }
  
  
  
  //  ,
  // {
  //   path: '/about',
  //   // route level code-splitting
  //   // this generates a separate chunk (about.[hash].js) for this route
  //   // which is lazy-loaded when the route is visited.
  //   component: () => import(/* webpackChunkName: "comm" */ '../views/Index.vue')
  // }
]

const router = new VueRouter({
  routes
	  ,mode: 'history'
})

export default router
